<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/mecss.css" th:href="@{/css/mecss.css}">
    <link rel="stylesheet" href="../../static/css/blog-background.css" th:href="@{/css/blog-background.css}">
</head>
<body>
<!--导航-->
<nav class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">Meteor</h2>
            <a href="#" th:href="@{/admin/blogMagt/1}" class="active m-item item m-mobile-hide"><i class="mini home icon m-margin-biaoqian"></i>博客</a>
            <a href="#" th:href="@{/type/1}" class="m-item item m-mobile-hide"><i class="mini idea icon m-margin-biaoqian"></i>分类</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="mini tags icon m-margin-biaoqian"></i>标签</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="mini clone icon m-margin-biaoqian"></i>归档</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="mini info icon m-margin-biaoqian"></i>关于我</a>
            <div class="right m-item m-mobile-hide menu">
                <div class="ui dropdown item">
                    <div class="text">
                        <img th:src="@{/image/touxiang.jpg}" class="ui avatar image" src="https://picsum.photos/800/600?image=1015">
                        <span th:text="${session.user.username}">Meteor</span>
                    </div>
                    <i class="ui dropdown icon">
                        <div class="menu">
                            <a href="#" th:href="@{/admin/logout}" class="item">注销</a>
                        </div>
                    </i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-top-right m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>
<!--中间内容-->
<div class="m-container-small m-padded-tb-big">
    <div class="ui container">
        <form action="#" th:action="@{/admin/blogMagt/1}" method="get" class="ui secondary segment form">
            <div class="inline fields">
                <div class="field">
                    <input type="text" name="title" placeholder="标题">
                </div>
                <div class="field">
                    <div class="ui selection dropdown">
                        <i class="dropdown icon"></i>
                        <div class="default text">分类</div>
                        <div class="menu">
                            <div class="item" data-value="1">错误日志</div>
                            <div class="item" data-value="1">开发者手册</div>
                        </div>
                    </div>
                </div>
                <div class="field">
                    <div class="ui checkbox">
                        <input type="checkbox" id="recommend" name="recommend">
                        <label for="recommend">推荐</label>
                    </div>
                </div>
                <div class="field">
                    <button class="ui mini submit teal basic button"><i class="search icon"></i>搜索</button>
                </div>
                <div th:text="${message}"></div>
            </div>
        </form>
        <table class="ui compact teal table">
            <thead>
            <tr>
                <th></th>
                <th>标题</th>
                <th>推荐</th>
                <th>更新时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="blog:${blogs}">
                <td th:text="${blog.id}">1</td>
                <td th:text="${blog.title}">练习清单</td>
                <td>是</td>
                <td th:text="${blog.updateTime}">2020-10-11 09:45</td>
                <td>
                    <a href="" th:href="@{/admin/update/{id}(id=${blog.id})}"
                       class="ui mini teal basic button">编辑</a>
                    <a href="" th:href="@{/admin/delete/{id}(id=${blog.id})}"
                       class="ui mini red basic button">删除</a>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <th colspan="6">
                    <div class="ui mini pagination menu">
                        <a th:href="@{/admin/blogMagt/{page}(page=${page.pageNum}-1)}" class="item">上一页</a>
                        <a th:href="@{/admin/blogMagt/{page}(page=${page.pageNum}+1)}" class="item">下一页</a>
                    </div>
                    <a href="#" th:href="@{/admin/blogSend}" class="ui mini right floated teal basic button" style="margin-top:8px">新增</a>
                </th>
            </tr>
            </tfoot>
        </table>
    </div>
</div>
<br>
<br>
<!-- 底部 -->
<footer th:replace="_fragments :: footer" class="ui inverted attached segment m-padded-tb-massive">
    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../../static/image/myvx.jpg" class="ui rounded image" alt="" style="width:100px">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">关于学习</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">经验分享</a>
                    <a href="#" class="item">酷爱编程</a>
                    <a href="#" class="item">CodingX</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">关于我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">喜欢记录</a>
                    <a href="#" class="item">热爱生活</a>
                    <a href="#" class="item">热爱祖国</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">关于博客</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">用来记录生活点滴、编程经验、完善自我技术、发泄情绪的心灵小屋</p>
                <p class="m-text-thin m-text-spaced m-opacity-mini">如果你也热爱编程、并且热爱祖国，可以加入我一起共同进步。</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">Copright @ 2022 Meteor Designed By </p>
    </div>
</footer>

<th:block th:replace="_fragments :: script">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
</th:block>

<script>
    $(".menu.toggle").click(function () {
        $(".m-item").toggleClass("m-mobile-hide");
    });
    $('.ui.dropdown').dropdown({
        on: 'click',
    });
</script>
</body>
</html>